#! /bin/sh

name=pcre2
version=10.45
revision=1
tarball_url="https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${version}/pcre2-${version}.tar.gz"
tarball_blake2b="e871e052853fac51d92fbfb5a2bb7a15b2830582315cfed047df8147c04f30c5a5e1ddd7275f6f894c33e2e170afdb2611937592907a29a025d665341e93b46a"
hostdeps="gcc pkg-config"
deps="core-libs bzip2 readline zlib"

prepare() {
    autotools_recursive_regen
}

configure() {
    autotools_configure \
        --enable-unicode \
        --enable-jit \
        --enable-pcre2-16 \
        --enable-pcre2-32 \
        --enable-pcre2grep-libz \
        --enable-pcre2grep-libbz2 \
        --enable-pcre2test-libreadline
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
